package com.yueka.service.Impl;

import com.yueka.mapper.*;
import com.yueka.pojo.activity.Activity;
import com.yueka.pojo.classroom.Classroom;
import com.yueka.pojo.experience.Experience;
import com.yueka.pojo.honor.Honor;
import com.yueka.pojo.instrument_category.InstrumentCategory;
import com.yueka.pojo.student.Student;
import com.yueka.pojo.teacher.Teacher;
import com.yueka.service.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class WebServiceImpl implements WebService {

    @Autowired
    private ActivityMapper activityMapper;

    @Autowired
    private TeacherMapper teacherMapper;

    @Autowired
    private InstrumentCategoryMapper instrumentCategoryMapper;

    @Autowired
    private HonorMapper honorMapper;

    @Autowired
    private ExperienceMapper experienceMapper;

    @Autowired
    private StudentMapper studentMapper;

    @Autowired
    private ClassroomMapper classroomMapper;

    @Override
    public List<Activity> getBanners() {
        return activityMapper.getBanners();
    }

    @Override
    public List<Activity> getActivityWebList() {
        return activityMapper.getActivityWebList();
    }

    @Override
    public List<Teacher> getTeacherList() {
        return teacherMapper.getTeacherList();
    }

    @Override
    public List<InstrumentCategory> getInstrumentList() {
        return instrumentCategoryMapper.getInstrumentList();
    }

    @Override
    public List<Honor> getHonorList() {
        return honorMapper.weblist();
    }

    @Override
    public List<Experience> getExperienceList() {
        return experienceMapper.weblist();
    }

    @Override
    public void webInsertStudent(Student student) {
        student.setCreateTime(LocalDateTime.now());
        student.setUpdateTime(LocalDateTime.now());
        student.setSource("2");
        student.setStatus("1");
        student.setAge(3);
        studentMapper.webInsertStudent(student);
    }

    @Override
    public List<Classroom> getClassroom() {
        return classroomMapper.getClassroom();
    }
}
